package day5.pet;

/**
 * @author oldliu
 * @since 1.0
 */
public class Gou {
    private String name;
    public static int legs=4;
    //静态代码块
    static{
        System.out.println("这里是静态的代码块");
    }
    public Gou(String name) {
        this.name = name;
    }
    public void show(){
        System.out.println("这条狗的名字叫"+name+",有"+legs+"条腿！");
    }
    //只能访问静态的属性
    public static void showLogs(){
        System.out.println("狗有"+legs+"条腿！");
        //System.out.println("狗的名字叫"+name);
    }

}
